import { reqGetProdList } from "@/api";
const state = {
  prodList: {},
};
const mutations = {
  GETPRODLIST(state, data) {
    state.prodList = data;
  },
};
const actions = {
  //获取商品
  async getProdList({ commit }, params) {
    const result = await reqGetProdList(params);
    result.code === 200 && commit("GETPRODLIST", result.data);
  },
};
const getters = {
  trademarkList(state) {
    return state.prodList.trademarkList || [];
  },
  attrsList(state) {
    return state.prodList.attrsList || [];
  },
};
export default {
  state,
  mutations,
  actions,
  getters,
};
